package com.fishery.authority.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fishery.authority.entity.UserRole;
import com.fishery.authority.mapper.UserRoleMapper;
import com.fishery.authority.service.UserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hy
 * @since 2021-01-18
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {

    /**
     * 根据userid查询roleid
     *
     * @param userId
     * @return
     */
    @Override
    public List<UserRole> findRoleIdByUserId(String userId) {
        QueryWrapper<UserRole> wrapper = new QueryWrapper();
        wrapper.eq("user_Id", userId);
        List<UserRole> roleList = baseMapper.selectList(wrapper);
        return roleList;
    }
}
